package com.seuic.hnapps.device_implement;

import android.os.Handler;
import android.os.Looper;

import com.seuic.android.ICCardReader;
import com.seuic.android.Pinpad;
import com.seuic.android.PosdService;
import com.seuic.android.Printer;
import com.seuic.android.SuperPinpad;
import com.seuic.extra.emv.EmvFuncs;
import com.seuic.extra.psam.IPsamReader;
import com.seuic.extra.receipt.Receipt;
import com.seuic.hnapps.posdsdk.device_interface.BaseInterface;


public class BaseImplement implements BaseInterface {

    protected static final String LOG_TAG = "PosdSdkImp";
    protected static String lastError = null;

    protected static PosdService posdService = null;

    protected static SuperPinpad superPinpad = null;
    protected static Pinpad pinpad = null;
    protected static Printer printer = null;
    protected static Receipt receipt = null;
    protected static ICCardReader icCardReader = null;
    protected static EmvFuncs emvFuncs = null;
    protected static IPsamReader psamReader = null;

    protected Handler handler = new Handler( Looper.getMainLooper() );

    protected void setLastError(String lastError) {
        BaseImplement.lastError = lastError;
    }

    protected void clearDeviceInterface() {
        posdService = null;
        superPinpad = null;
        pinpad = null;
        printer = null;
        receipt = null;
        icCardReader = null;
        emvFuncs = null;
        psamReader = null;
    }

    @Override
    public String getLastError() {
        return lastError;
    }
}
